package com.bh.quartz.task;

import com.bh.common.core.redis.RedisCache;
import com.bh.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 *
 * @author ruo-yi
 */
@Component("ryTask")
public class RyTask {

    @Autowired
    public RedisCache redisCache;

    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    /**
     * 每天1点触发
     */
    @Scheduled(cron="0 0 1 * * ?", zone = "GMT+8")
    public void setNullShortIdSetKey() {
        redisCache.deleteObject("short_id_set");
    }
}
